<?php

namespace App\Http\Controllers;

use DB;

class InformCheckController extends Controller
{
    public function index(){
        $nowTime = date("Y-m-d H:i:s");        
        $informSendResult = DB::table("im_inform")
            ->select("id")
            ->where("could_send_time","<=",$nowTime)
            ->where("is_sent",false)
            ->where("is_closed",false)
            ->where("is_deleted",false)
            ->get();

        foreach ($informSendResult as $key => $value) {
            $informId = $value->id;
            //$this->api->put("inform/$informId/send");
        }
        return $this::jsonResponse(false,count($informSendResult));
    }
}